import {
  formatIntFloatNumber,
  formatNumber,
  formatPercent,
} from '@/utils/number';

export const DEFAULT_DUALAXES_CONFIG = {
  xField: 'date',
  yField: ['value', 'count'],
  height: 300,
  geometryOptions: [
    {
      geometry: 'line',
      seriesField: 'label',
      point: {},
    },
    {
      geometry: 'line',
      seriesField: 'name',
      lineStyle: {
        lineWidth: 3,
        lineDash: [5, 5],
      },
      smooth: true,
    },
  ],
  yAxis: {
    value: {
      label: {
        formatter: formatNumber,
      },
    },
    count: {
      label: {
        formatter: formatPercent,
      },
    },
  },
  tooltip: {
    formatter: (datum) => ({
      name: datum.label || datum.name,
      value: datum.label
        ? formatIntFloatNumber(datum.value)
        : formatPercent(datum.count),
    }),
  },
  autoFit: false,
};
